# 从minio桶中下载文件到本地

from minio import Minio

# PREFIX='72b4a9_zihuanke/2023'

# 多年的一起复制
PREFIX=''

client = Minio('127.0.0.1:9000', access_key='minioadmin', secret_key='minioadmin', secure=False)

objects = client.list_objects('docs', prefix=PREFIX, recursive=True)

for obj in objects:
    new_name = obj.object_name.replace(PREFIX, '')
    print(new_name)
    client.fget_object('docs', obj.object_name, f'./dist/{PREFIX.replace("/", "_")}' + new_name)




